import {searchDetail} from "../../api/sellOrderDetail"
import {addSellReturnOrder} from "../../api/sellReturnOrderDetail"

let sellReturnOrderDetail = {
    data() {
        return {
            sellCode:'',
            sellOrderDetail:{},
            goodsList:[],
            refuseReasonOptions:[
                {
                    value:'未在家',
                    label:'未在家'
                },
                {
                    value:'不要了',
                    label:'不要了'
                }
            ]
        };
    },
    methods:{
        async orderDetail(){
            let sellCode = this.sellCode;
            let response = await searchDetail(sellCode);
            this.sellOrderDetail = response;
            this.goodsList = response.sellOrderGoodsList;
        },
        pageBack(){
            this.$router.push("/sellReturnOrder");
        },
        async createSellReturnOrder(){
            let response = await addSellReturnOrder(this.sellOrderDetail);
            alert(response);
        }
    },
    created(){
        this.sellCode = this.$route.params.sellCode;
        this.orderDetail();
    }
};

export default sellReturnOrderDetail;